<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>OCILIB (C and C++ Driver for Oracle): Formatted functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">OCILIB (C and C++ Driver for Oracle)
   &#160;<span id="projectnumber">4.2.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>About</span></a></li>
      <li><a href="modules.html"><span>Documentation</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group___ocilib_c_api_formatting.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Formatted functions<div class="ingroups"><a class="el" href="group___ocilib_c_api.html">C API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>OCILIB offers some smart routines that takes a variable number of arguments in order to minimize OCILIB function calls and reduce the amount of code lines</p>
<p>On Windows platforms, the target programming language must support the __cdecl calling convention</p>
<dl class="section note"><dt>Note</dt><dd><a class="el" href="group___ocilib_c_api_formatting.html#gafc660530b550458f0b5578a06e7a7a27" title="Perform 3 calls (prepare+execute+fetch) in 1 call. ">OCI_Immediate()</a> and <a class="el" href="group___ocilib_c_api_formatting.html#ga24a69e3d1d683ce6023afd687af78720" title="Performs 4 call (prepare+bind+execute+fetch) in 1 call. ">OCI_ImmediateFmt()</a> support all OCILIB supported types for output result, except :<ul>
<li>OCI_Long</li>
<li>OCI_Statement If a query output result contains one of these unsupported types, the function returns FALSE</li>
</ul>
</dd>
<dd>
In the parameter list, every output placeholder MUST be preceded by an integer parameter that indicates the type of the placeholder in order to handle correctly the given pointer.</dd></dl>
<p>Possible values for indicating placeholders type :</p>
<ul>
<li>OCI_ARG_SHORT ---&mdash;&gt; short *</li>
<li>OCI_ARG_USHORT --&mdash;&gt; unsigned short *</li>
<li>OCI_ARG_INT -----&mdash;&gt; int *</li>
<li>OCI_ARG_UINT ----&mdash;&gt; unsigned int*</li>
<li>OCI_ARG_BIGINT --&mdash;&gt; big_int *</li>
<li>OCI_ARG_BIGUINT -&mdash;&gt; unsigned big_int *</li>
<li>OCI_ARG_DOUBLE -&mdash;&gt; double *</li>
<li>OCI_ARG_FLOAT ---&mdash;&gt; float *</li>
<li>OCI_ARG_TEXT ----&mdash;&gt; otext *</li>
<li>OCI_ARG_RAW -----&mdash;&gt; void *</li>
<li>OCI_ARG_DATETIME &mdash;&gt; OCI_Date *</li>
<li>OCI_ARG_LOB -----&mdash;&gt; OCI_Lob *</li>
<li>OCI_ARG_FILE ----&mdash;&gt; OCI_File *</li>
<li>OCI_ARG_TIMESTAMP &ndash;&gt; OCI_Timestamp *</li>
<li>OCI_ARG_INTERVAL &mdash;&gt; OCI_Interval *</li>
<li>OCI_ARG_OBJECT --&mdash;&gt; OCI_Object *</li>
<li>OCI_ARG_COLLECTION -&gt; OCI_Coll *</li>
<li>OCI_ARG_REF -----&mdash;&gt; OCI_Ref *</li>
</ul>
<dl class="section note"><dt>Note</dt><dd>For output strings and Raws, returned data is copied to the given buffer instead of returning a pointer the real data. So these buffers must be big enough to hold the column content. No size check is performed.</dd></dl>
<ul>
<li>For strings, only the real string is copied.</li>
<li>For Raws, the number of bytes copied is the column size</li>
</ul>
<dl class="section warning"><dt>Warning</dt><dd>Input parameters for formatted function only support a restricted set of data types !</dd></dl>
<p>Supported input identifiers :</p>
<ul>
<li>'s' : (otext *) -------&mdash;&gt; input string (quotes are added)</li>
<li>'m' : (otext *) -------&mdash;&gt; meta data string (no quotes added)</li>
<li>'t' : (OCI_Date *) ----&mdash;&gt; Date</li>
<li>'p' : (OCI_Timestamp *) &ndash;&gt; timestamp</li>
<li>'v' : (OCI_Interval *) &mdash;&gt; Interval</li>
<li>'i' : (int) -----------&mdash;&gt; signed 32 bits integer</li>
<li>'u' : (unsigned int) --&mdash;&gt; unsigned 32 bits integer</li>
<li>'li' : (big_int) -------&mdash;&gt; signed 64 bits integer</li>
<li>'lu' : (big_uint) ------&mdash;&gt; unsigned 64 bits integer</li>
<li>'hi' : (short) ---------&mdash;&gt; signed 16 bits integer</li>
<li>'hu' : (unsigned short) &mdash;&gt; unsigned 16 bits integer</li>
<li>'g' : (double, float ) &mdash;&gt; Numerics</li>
<li>'r' : (OCI_Ref *) -----&mdash;&gt; Reference</li>
<li>'o' : (OCI_Object *) --&mdash;&gt; Object (not implemented yet)</li>
<li>'c' : (OCI_Coll *) ----&mdash;&gt; collection (not implemented yet)</li>
</ul>
<dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include &quot;ocilib.h&quot;</span></div>
<div class="line"></div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a> *cn;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a>  *st;</div>
<div class="line">    <a class="code" href="group___ocilib_c_api_datatypes.html#gae0c7aa9c507975d21ca6c261081ba753">OCI_Resultset</a>  *rs;</div>
<div class="line"> </div>
<div class="line">    <span class="keywordtype">int</span> code = 1;</div>
<div class="line">    <span class="keywordtype">char</span> name[50];</div>
<div class="line">  </div>
<div class="line">    <span class="keywordflow">if</span> (!<a class="code" href="group___ocilib_c_api_initialization.html#ga01464863ddd68393106b63fb8cc1ead1">OCI_Initialize</a>(NULL, NULL, OCI_ENV_DEFAULT))</div>
<div class="line">        <span class="keywordflow">return</span> EXIT_FAILURE;</div>
<div class="line"></div>
<div class="line">    cn = <a class="code" href="group___ocilib_c_api_connections.html#ga5cd867ad94bdc4a3bbfdef24452262e0">OCI_ConnectionCreate</a>(<span class="stringliteral">&quot;db&quot;</span>, <span class="stringliteral">&quot;usr&quot;</span>, <span class="stringliteral">&quot;pwd&quot;</span>, OCI_SESSION_DEFAULT);</div>
<div class="line">    st = <a class="code" href="group___ocilib_c_api_statements.html#ga335822f983af0fb5c529431f06a9a17b">OCI_StatementCreate</a>(cn);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/* sql format with params ----------------------------------------------- */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_formatting.html#gac8346cd7d4c86cd2c57175bfd77094a9">OCI_ExecuteStmtFmt</a>(st, <span class="stringliteral">&quot;select article from test_fetch where code = %i&quot;</span>, code);</div>
<div class="line"></div>
<div class="line">    rs = <a class="code" href="group___ocilib_c_api_fetching.html#gaf2a9e28b66a9538ba0ffb62bffb87c16">OCI_GetResultset</a>(st);</div>
<div class="line"></div>
<div class="line">    <span class="keywordflow">while</span> (<a class="code" href="group___ocilib_c_api_fetching.html#ga36ac26dcea78f6074421781e401f97ba">OCI_FetchNext</a>(rs))</div>
<div class="line">        printf(<span class="stringliteral">&quot;article : %s\n&quot;</span>, <a class="code" href="group___ocilib_c_api_fetching.html#ga2a3252984f674fab5358c94d58c689b2">OCI_GetString</a>(rs, 1));</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* sql immediate (parse, exec, one fetch) ------------------------------- */</span></div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_formatting.html#gafc660530b550458f0b5578a06e7a7a27">OCI_Immediate</a>(cn, <span class="stringliteral">&quot;select code, article from test_fetch where code = 1&quot;</span>, </div>
<div class="line">                  OCI_ARG_INT, &amp;code, OCI_ARG_TEXT, name);</div>
<div class="line"></div>
<div class="line">    printf(<span class="stringliteral">&quot;article : %s - code %i\n&quot;</span>, name, code);</div>
<div class="line"></div>
<div class="line">    <span class="comment">/* sql immediate (parse, exec, one fetch) with params ------------------- */</span></div>
<div class="line"></div>
<div class="line">    </div>
<div class="line">    <a class="code" href="group___ocilib_c_api_formatting.html#ga24a69e3d1d683ce6023afd687af78720">OCI_ImmediateFmt</a>(cn, <span class="stringliteral">&quot;select article from test_fetch where code = %i&quot;</span>, </div>
<div class="line">                          code, OCI_ARG_TEXT, name);</div>
<div class="line"></div>
<div class="line">    printf(<span class="stringliteral">&quot;article : %s\n&quot;</span>, name);</div>
<div class="line"></div>
<div class="line">    <a class="code" href="group___ocilib_c_api_initialization.html#ga639706aa8e9689c7ebffc018fac6d3ae">OCI_Cleanup</a>();</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> EXIT_SUCCESS;</div>
<div class="line">}</div>
</div><!-- fragment --> </dd></dl>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gafc660530b550458f0b5578a06e7a7a27"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_formatting.html#gafc660530b550458f0b5578a06e7a7a27">OCI_Immediate</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a> *con, const otext *sql,...)</td></tr>
<tr class="memdesc:gafc660530b550458f0b5578a06e7a7a27"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform 3 calls (prepare+execute+fetch) in 1 call.  <a href="#gafc660530b550458f0b5578a06e7a7a27">More...</a><br /></td></tr>
<tr class="separator:gafc660530b550458f0b5578a06e7a7a27"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga24a69e3d1d683ce6023afd687af78720"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_formatting.html#ga24a69e3d1d683ce6023afd687af78720">OCI_ImmediateFmt</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a> *con, const otext *sql,...)</td></tr>
<tr class="memdesc:ga24a69e3d1d683ce6023afd687af78720"><td class="mdescLeft">&#160;</td><td class="mdescRight">Performs 4 call (prepare+bind+execute+fetch) in 1 call.  <a href="#ga24a69e3d1d683ce6023afd687af78720">More...</a><br /></td></tr>
<tr class="separator:ga24a69e3d1d683ce6023afd687af78720"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga98e18f76f3161fd9b386be4c353eab55"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_formatting.html#ga98e18f76f3161fd9b386be4c353eab55">OCI_PrepareFmt</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a> *stmt, const otext *sql,...)</td></tr>
<tr class="memdesc:ga98e18f76f3161fd9b386be4c353eab55"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prepare a formatted SQL statement or PL/SQL block.  <a href="#ga98e18f76f3161fd9b386be4c353eab55">More...</a><br /></td></tr>
<tr class="separator:ga98e18f76f3161fd9b386be4c353eab55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac8346cd7d4c86cd2c57175bfd77094a9"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_formatting.html#gac8346cd7d4c86cd2c57175bfd77094a9">OCI_ExecuteStmtFmt</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a> *stmt, const otext *sql,...)</td></tr>
<tr class="memdesc:gac8346cd7d4c86cd2c57175bfd77094a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Execute a formatted SQL statement or PL/SQL block.  <a href="#gac8346cd7d4c86cd2c57175bfd77094a9">More...</a><br /></td></tr>
<tr class="separator:gac8346cd7d4c86cd2c57175bfd77094a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga19280a6fa1145c226e83ebb77ef4a7c6"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_formatting.html#ga19280a6fa1145c226e83ebb77ef4a7c6">OCI_ParseFmt</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a> *stmt, const otext *sql,...)</td></tr>
<tr class="memdesc:ga19280a6fa1145c226e83ebb77ef4a7c6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse a formatted SQL statement or PL/SQL block.  <a href="#ga19280a6fa1145c226e83ebb77ef4a7c6">More...</a><br /></td></tr>
<tr class="separator:ga19280a6fa1145c226e83ebb77ef4a7c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga88a9c691edf142d9412df764435c9c7a"><td class="memItemLeft" align="right" valign="top">OCI_EXPORT boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ocilib_c_api_formatting.html#ga88a9c691edf142d9412df764435c9c7a">OCI_DescribeFmt</a> (<a class="el" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a> *stmt, const otext *sql,...)</td></tr>
<tr class="memdesc:ga88a9c691edf142d9412df764435c9c7a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Describe the select list of a formatted SQL select statement.  <a href="#ga88a9c691edf142d9412df764435c9c7a">More...</a><br /></td></tr>
<tr class="separator:ga88a9c691edf142d9412df764435c9c7a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gafc660530b550458f0b5578a06e7a7a27"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_Immediate </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a> *&#160;</td>
          <td class="paramname"><em>con</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>sql</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Perform 3 calls (prepare+execute+fetch) in 1 call. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">con</td><td>- Connection handle </td></tr>
    <tr><td class="paramname">sql</td><td>- SQL statement </td></tr>
    <tr><td class="paramname">...</td><td>- List of program variables address to store the result of fetch operation</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Every output parameter MUST be preceded by an integer parameter that indicates the type of the placeholder in order to handle correctly the given pointer.</dd></dl>
<p>TRUE on success otherwise FALSE </p>

</div>
</div>
<a class="anchor" id="ga24a69e3d1d683ce6023afd687af78720"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_ImmediateFmt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga2135d3b5341ebbaae1f54d62873ecf77">OCI_Connection</a> *&#160;</td>
          <td class="paramname"><em>con</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>sql</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Performs 4 call (prepare+bind+execute+fetch) in 1 call. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">con</td><td>- Connection handle </td></tr>
    <tr><td class="paramname">sql</td><td>- SQL statement </td></tr>
    <tr><td class="paramname">...</td><td>- List of program values to format the SQL followed by the output variables addresses for the fetch operation</td></tr>
  </table>
  </dd>
</dl>
<p>TRUE on success otherwise FALSE </p>

</div>
</div>
<a class="anchor" id="ga98e18f76f3161fd9b386be4c353eab55"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_PrepareFmt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a> *&#160;</td>
          <td class="paramname"><em>stmt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>sql</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Prepare a formatted SQL statement or PL/SQL block. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">stmt</td><td>- Statement handle </td></tr>
    <tr><td class="paramname">sql</td><td>- SQL statement </td></tr>
    <tr><td class="paramname">...</td><td>- List of program values to format the SQL</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

</div>
</div>
<a class="anchor" id="gac8346cd7d4c86cd2c57175bfd77094a9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_ExecuteStmtFmt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a> *&#160;</td>
          <td class="paramname"><em>stmt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>sql</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Execute a formatted SQL statement or PL/SQL block. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">stmt</td><td>- Statement handle </td></tr>
    <tr><td class="paramname">sql</td><td>- SQL statement </td></tr>
    <tr><td class="paramname">...</td><td>- List of program values to format the SQL</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>If a SQL warning occurs:<ul>
<li>the function returns TRUE</li>
<li>the SQL warning triggers the global error handler with an OCI_Error having its <a class="el" href="group___ocilib_c_api_error_handling.html#ga66d447c8cd06ea3f841b439a1aac055b" title="Retrieve the type of error from error handle. ">OCI_ErrorGetType()</a> attribute set to OCI_ERR_WARNING</li>
<li>If OCILIB is initialized with the OCI_ENV_CONTEXT mode, <a class="el" href="group___ocilib_c_api_error_handling.html#gaf2abe52ad5b278f65dd97a44a2adac4c" title="Retrieve the last error or warning occurred within the last OCILIB call. ">OCI_GetLastError()</a> will return the OCI_Error object corresponding to the warning </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="ga19280a6fa1145c226e83ebb77ef4a7c6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_ParseFmt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a> *&#160;</td>
          <td class="paramname"><em>stmt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>sql</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Parse a formatted SQL statement or PL/SQL block. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">stmt</td><td>- Statement handle </td></tr>
    <tr><td class="paramname">sql</td><td>- SQL statement </td></tr>
    <tr><td class="paramname">...</td><td>- List of program values to format the SQL</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This call sends the SQL or PL/SQL command to the server for parsing only. The command is not executed. This call is only useful to check is a command is valid or not.</dd>
<dd>
This call prepares the statement (internal call to <a class="el" href="group___ocilib_c_api_statements.html#ga592e4b3cf3df7e152c46fab5d6e3b3af" title="Prepare a SQL statement or PL/SQL block. ">OCI_Prepare()</a>) and ask the Oracle server to parse its SQL or PL/SQL command. <a class="el" href="group___ocilib_c_api_statements.html#ga7189aa353845909aaedc8d5956429450" title="Execute a prepared SQL statement or PL/SQL block. ">OCI_Execute()</a> can be call after <a class="el" href="group___ocilib_c_api_formatting.html#ga19280a6fa1145c226e83ebb77ef4a7c6" title="Parse a formatted SQL statement or PL/SQL block. ">OCI_ParseFmt()</a> in order to execute the statement, which means that the server will re-parse again the command.</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>Do not use <a class="el" href="group___ocilib_c_api_formatting.html#ga19280a6fa1145c226e83ebb77ef4a7c6" title="Parse a formatted SQL statement or PL/SQL block. ">OCI_ParseFmt()</a> unless you're only interested in the parsing result because the statement will be parsed again when executed and thus leading to unnecessary server round-trips and less performance</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

</div>
</div>
<a class="anchor" id="ga88a9c691edf142d9412df764435c9c7a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">OCI_EXPORT boolean OCI_DescribeFmt </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___ocilib_c_api_datatypes.html#ga4b016f1bd7de508b1a919e34b12aa83d">OCI_Statement</a> *&#160;</td>
          <td class="paramname"><em>stmt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const otext *&#160;</td>
          <td class="paramname"><em>sql</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>...</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><code>#include &lt;ocilib.h&gt;</code></p>

<p>Describe the select list of a formatted SQL select statement. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">stmt</td><td>- Statement handle </td></tr>
    <tr><td class="paramname">sql</td><td>- SQL statement </td></tr>
    <tr><td class="paramname">...</td><td>- List of program values to format the SQL</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This call sends the SELECT SQL order to the server for retrieving the description of the select order only. The command is not executed. This call is only useful to retrieve information on the associated resultset Call OCI_GetResultet() after <a class="el" href="group___ocilib_c_api_statements.html#ga420f21e4b00ce3e35ee15ed1e109ead1" title="Describe the select list of a SQL select statement. ">OCI_Describe()</a> to access to SELECT list information</dd>
<dd>
This call prepares the statement (internal call to <a class="el" href="group___ocilib_c_api_statements.html#ga592e4b3cf3df7e152c46fab5d6e3b3af" title="Prepare a SQL statement or PL/SQL block. ">OCI_Prepare()</a>) and ask the Oracle server to describe the output SELECT list. <a class="el" href="group___ocilib_c_api_statements.html#ga7189aa353845909aaedc8d5956429450" title="Execute a prepared SQL statement or PL/SQL block. ">OCI_Execute()</a> can be call after OCI_Desbribe() in order to execute the statement, which means that the server will parse, and describe again the SQL order.</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>Do not use OCI_Desbribe() unless you're only interested in the resultset information because the statement will be parsed again when executed and thus leading to unnecessary server round-trips and less performance</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>TRUE on success otherwise FALSE </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Mon Mar 21 2016 22:26:37 for OCILIB (C and C++ Driver for Oracle) by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
